package com.lsfb.duishangbaos.Order;

import android.content.Context;
import android.view.View;

import com.lsfb.duishangbaos.MoneyManage.MyDetailBean;
import com.lsfb.duishangbaos.R;
import com.zgscwjm.lsfbbasetemplate.Event.LsfbEvent;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/5/12 0012.
 */

public class EarningsMoneyAdapter extends CommonAdapter<MyDetailBean.ListBean> {
    public EarningsMoneyAdapter(Context context, int layoutId, List<MyDetailBean.ListBean> list) {
        super(context, layoutId, list);
    }

    @Override
    public void convert(ViewHolder holder, final MyDetailBean.ListBean model) {
        holder.setText(R.id.item_laiyuan,model.getUname());
        holder.setText(R.id.item_text_time,model.getC_time());
        holder.setText(R.id.item_text_money,"+"+model.getCash());

        holder.setOnclick(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                OrderClickEvent event=new OrderClickEvent();
                // TODO: 2017/7/24 0024 这里缺失ID
                event.setData(model.getC_time());
                LsfbEvent.getInstantiation().post(event);
            }
        });

    }
}
